package com.rc.web.controller;

import com.mybatisflex.core.paginate.Page;
import com.rc.common.annotate.WithoutTenant;
import com.rc.pojo.dto.identify.IdentifyAddDTO;
import com.rc.pojo.dto.identify.IdentifyQuery;
import com.rc.pojo.po.Identify;
import com.rc.web.service.IdentifyService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 活动表 控制层。
 *
 * @author sym
 * @since 2024-05-26
 */
@RestController
@RequestMapping("/identify")
@Api(tags = "识别结果")
@RequiredArgsConstructor
@Validated
public class IdentifyController {
    private final IdentifyService identifyService;

    @PostMapping
    public void add(IdentifyAddDTO dto) {
        identifyService.add(dto);
    }

    @DeleteMapping("/{id}")
    @WithoutTenant
    public void deleteOneById(@PathVariable Long id) {
        identifyService.removeById(id);
    }

    @GetMapping("/page")
    @WithoutTenant
    public Page<Identify> getPage(IdentifyQuery query){
        return identifyService.getPage(query);
    }

}
